package com.scorpio.chatnotify.service.impl;

import com.scorpio.chatnotify.domain.AutoGreetRecordEntity;
import com.scorpio.chatnotify.mapper.AutoGreetRecordMapper;
import com.scorpio.chatnotify.service.AutoGreetRecordService;
import com.scorpio.common.annotation.DataSource;
import com.scorpio.common.enums.DataSourceType;
import com.scorpio.common.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DataSource(DataSourceType.SLAVE)
public class AutoGreetRecordServiceImpl extends BaseServiceImpl<AutoGreetRecordMapper, AutoGreetRecordEntity> implements AutoGreetRecordService {

    @Override
    public int save(AutoGreetRecordEntity entity) {
        return baseDao.insert(entity);
    }

    @Override
    public int countByUserId(Long userId) {
        return baseDao.countToDaySendTotal(userId);
    }
}
